//
//  FPCommodityHeaderView.m
//  ForestPack
//
//  Created by jimmy on 2018/7/10.
//  Copyright © 2018年 郑洲. All rights reserved.
//

#import "FPCommodityHeaderView.h"
#import "SDCycleScrollView.h"
#import "Masonry.h"
#import "YZTagList.h"
#import "UIView+Utils.h"
#import "YZTagButton.h"
#import "PaperBoxDetialModel.h"

@interface  FPCommodityHeaderView()<SDCycleScrollViewDelegate>

@property (nonatomic,strong)  UILabel  * titleLabel;
@property (nonatomic,strong)  UILabel  * contentLabel;
@property (nonatomic,strong)  UILabel  * priceLabel;
@property (nonatomic,strong)  SDCycleScrollView  * scrollPicsView;


@end

@implementation FPCommodityHeaderView

+ (FPCommodityHeaderView *)sectionViewWithHeight:(CGFloat)height
{
    FPCommodityHeaderView * sectionView = [[FPCommodityHeaderView alloc] initWithHeight:height];
    
    return sectionView;
}

- (instancetype)initWithHeight:(CGFloat)height
{
    self = [super init];
    if (self) {
        [self setViewUIWithHeight:height];
    }
    return self;
}

-(void)initCaseDetailDataModel:(CaseDetailDataModel *)caseDetailDataModel
{
    _caseDetailDataModel = caseDetailDataModel;
    
    self.titleLabel.text = self.caseDetailDataModel.design_name;
    self.contentLabel.text = self.caseDetailDataModel.design_des;
    self.priceLabel.text = [NSString stringWithFormat:@"￥%@",self.caseDetailDataModel.price];
    //遍历pics数组得到每一个url然后放到数组里
    NSMutableArray *picsArray = [NSMutableArray array];
    for (NSString *picsUrl in self.caseDetailDataModel.pics) {
        picsArray = [NSMutableArray arrayWithObject:picsUrl];
    }
//    NSArray *array = @[];//@[[UIImage imageNamed:@"商品背景图"],[UIImage imageNamed:@"商品背景图"],[UIImage imageNamed:@"商品背景图"],[UIImage imageNamed:@"商品背景图"]]
    self.scrollPicsView.localizationImageNamesGroup = picsArray;    
}

-(void)initCommodityDetailDataModel:(CommodityDetailDataModel *)commodityDetailDataModel
{
    _commodityDetailDataModel = commodityDetailDataModel;
    
    self.titleLabel.text = self.commodityDetailDataModel.design_name;
    self.contentLabel.text = self.commodityDetailDataModel.design_des;
    self.priceLabel.text = [NSString stringWithFormat:@"￥%@",self.commodityDetailDataModel.price];
    //遍历pics数组得到每一个url然后放到数组里
    NSMutableArray *picsArray = [NSMutableArray array];
    for (NSString *picsUrl in self.commodityDetailDataModel.pics) {
        picsArray = [NSMutableArray arrayWithObject:picsUrl];
    }
    //    NSArray *array = @[];//@[[UIImage imageNamed:@"商品背景图"],[UIImage imageNamed:@"商品背景图"],[UIImage imageNamed:@"商品背景图"],[UIImage imageNamed:@"商品背景图"]]
    self.scrollPicsView.localizationImageNamesGroup = picsArray;
}

- (void)setViewUIWithHeight:(CGFloat)height
{
    UIView *view = [[UIView alloc] init];
    [self addSubview:view];
    [view mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.mas_left);
        make.right.equalTo(self.mas_right);
        make.width.equalTo(self.mas_width);
        make.height.equalTo(self.mas_height);
    }];
    
    self.scrollPicsView = [[SDCycleScrollView alloc] init];
    self.scrollPicsView.backgroundColor = UIColorFromRGB(@"E6E6E6", 1);
    self.scrollPicsView.currentPageDotColor = RGB_COLOR(237,34,59);
    self.scrollPicsView.pageDotColor = RGB_COLOR(238,238,238);
//    [scrollView setCurrentPageDotImage:[UIImage imageNamed:@"轮播圈红色"]];
    self.scrollPicsView.showPageControl = YES;
    self.scrollPicsView.autoScrollTimeInterval = 4.0;
//    NSMutableArray *photoArray = [NSMutableArray array];
//    scrollView.imageURLStringsGroup = array;
//    NSArray *array = @[[UIImage imageNamed:@"商品背景图"],[UIImage imageNamed:@"商品背景图"],[UIImage imageNamed:@"商品背景图"],[UIImage imageNamed:@"商品背景图"]];
//    self.scrollPicsView.localizationImageNamesGroup = array;
    self.scrollPicsView.scrollDirection = UICollectionViewScrollDirectionHorizontal;
    self.scrollPicsView.pageControlAliment = SDCycleScrollViewPageContolAlimentCenter;
    self.scrollPicsView.delegate = self;
    [view addSubview:self.scrollPicsView];
    [self.scrollPicsView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.mas_left);
        make.top.equalTo(self.mas_top);
        make.width.equalTo(self.mas_width);
        make.height.equalTo(@190);
    }];
    
    UIImageView * leftImageV = [[UIImageView alloc] init];
    leftImageV.image = [UIImage imageNamed:@"红色矩形"];
    leftImageV.contentMode = UIViewContentModeScaleToFill;
    [view addSubview:leftImageV];
    [leftImageV mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.mas_left);
        make.top.equalTo(self.scrollPicsView.mas_bottom).offset(20);
        make.width.equalTo(@(3));
        make.height.equalTo(@23);
    }];
    
    self.titleLabel = [[UILabel alloc] init];
    [self.titleLabel setText: @"企业公司品牌logo卡通设计图片标志"];
    self.titleLabel.numberOfLines = 0;
    self.titleLabel.textColor = FONTCOLOR_BLACK;
    self.titleLabel.font = Kfont(18);
    self.titleLabel.textAlignment = NSTextAlignmentLeft;
    [view addSubview:self.titleLabel];
    [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(view.mas_left).offset(13);
        make.top.equalTo(self.scrollPicsView.mas_bottom).offset(18);
        make.width.equalTo(@(SCREEN_WIDTH - 60));
        make.height.equalTo(@23);
    }];
    
    self.contentLabel = [[UILabel alloc] init];
    [self.contentLabel setText: @"logo平面设计"];
    self.contentLabel.numberOfLines = 0;
    self.contentLabel.textColor = FONTCOLOR_BLACK;
    self.contentLabel.font = Kfont(18);
    self.contentLabel.textAlignment = NSTextAlignmentLeft;
    [view addSubview:self.contentLabel];
    [self.contentLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(view.mas_left).offset(13);
        make.top.equalTo(self.titleLabel.mas_bottom);
        make.width.equalTo(@(SCREEN_WIDTH - 60));
        make.height.equalTo(@23);
    }];
    
    self.shareImageV = [[UIImageView alloc] init];
    self.shareImageV.image = [UIImage imageNamed:@"分享"];
    [view addSubview:self.shareImageV];
    [self.shareImageV mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(view.mas_right).offset(-13);
        make.top.equalTo(self.scrollPicsView.mas_bottom).offset(20);
        make.width.equalTo(@19);
        make.height.equalTo(@22);
    }];
    
    self.priceLabel = [[UILabel alloc] init];
    self.priceLabel.text = @"￥990";
    self.priceLabel.textColor = RGB_COLOR(237,34,59);
    self.priceLabel.font = Kfont(18);
    self.priceLabel.textAlignment = NSTextAlignmentLeft;
    [view addSubview:self.priceLabel];
    [self.priceLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(view.mas_left).offset(13);
        make.top.equalTo(self.contentLabel.mas_bottom);
        make.width.equalTo(@(SCREEN_WIDTH - 100));
        make.height.equalTo(@18);
    }];
    
    UILabel *lineLabel = [[UILabel alloc] init];
    lineLabel.backgroundColor = RGB_COLOR(220,220,220);
    [view addSubview:lineLabel];
    [lineLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.mas_left);
        make.top.equalTo(self.mas_bottom);
        make.right.equalTo(self.mas_right);
        make.height.equalTo(@1);
    }];
    
}


@end


@interface DesignSecondSectionHeaderView()

@property (nonatomic,strong)  UIImageView * leftImageV;
@property (nonatomic,strong)  UILabel     * titleLabel;
@property (nonatomic,strong)  UILabel     * contentLabel;
@property (nonatomic,strong)  UILabel     * placeLabel;

@end

@implementation DesignSecondSectionHeaderView

+ (DesignSecondSectionHeaderView *)sectionHeaderViewWithHeight:(CGFloat)height
{
    DesignSecondSectionHeaderView * sectionView = [[DesignSecondSectionHeaderView alloc] initWithHeight:height];
    
    return sectionView;
}

- (instancetype)initWithHeight:(CGFloat)height
{
    self = [super init];
    if (self) {
        [self setViewUIWithHeight:height];
    }
    return self;
}

-(void)initCaseDetailShopModel:(CaseDetailShopModel *)caseDetailShopModel
{
    _caseDetailShopModel = caseDetailShopModel;
    
    [self.leftImageV sd_setImageWithURL:[NSURL URLWithString:self.caseDetailShopModel.logo]];
    self.titleLabel.text = caseDetailShopModel.name;
    NSString *volumStr = [NSString stringWithFormat:@"成交%@笔 | ",caseDetailShopModel.volume];
    NSString *zongfenStr = [NSString stringWithFormat:@" 好评%@ | ",caseDetailShopModel.zongfen];
    if (caseDetailShopModel.distance.length >= 4 || caseDetailShopModel.distance.length <= 8) {
        NSString *distanceStr = [NSString stringWithFormat:@" %ld.",(([caseDetailShopModel.distance integerValue]/1000))];
        self.contentLabel.text = [[[volumStr stringByAppendingString:zongfenStr] stringByAppendingString:distanceStr] stringByAppendingString:[NSString stringWithFormat:@"%ld km",(([caseDetailShopModel.distance integerValue]%1000))]];
    }else if(caseDetailShopModel.distance.length <= 3){
        self.contentLabel.text = [[[NSString stringWithFormat:@" 成交%@笔 | ",caseDetailShopModel.volume] stringByAppendingString:[NSString stringWithFormat:@" 好评%@ | ",caseDetailShopModel.volume]] stringByAppendingString:[NSString stringWithFormat:@"%@m",caseDetailShopModel.distance]];
    }else{
        self.contentLabel.text = [[[NSString stringWithFormat:@" 成交%@笔 | ",caseDetailShopModel.volume] stringByAppendingString:[NSString stringWithFormat:@" 好评%@ | ",caseDetailShopModel.volume]] stringByAppendingString:[NSString stringWithFormat:@" %ldkm",([caseDetailShopModel.distance integerValue]/1000)]];
    }
    self.placeLabel.text = caseDetailShopModel.address;
}

-(void)initCommodityDetailShopModel:(CommodityDetailShopModel *)commodityDetailShopModel
{
    _commodityDetailShopModel = commodityDetailShopModel;
    
    [self.leftImageV sd_setImageWithURL:[NSURL URLWithString:self.commodityDetailShopModel.logo]];
    self.titleLabel.text = commodityDetailShopModel.name;
    NSString *volumStr = [NSString stringWithFormat:@"成交%@笔 | ",commodityDetailShopModel.volume];
    NSString *zongfenStr = [NSString stringWithFormat:@" 好评%@ | ",commodityDetailShopModel.zongfen];
    if (commodityDetailShopModel.distance.length >= 4 || commodityDetailShopModel.distance.length <= 8) {
        NSString *distanceStr = [NSString stringWithFormat:@" %ld.",(([commodityDetailShopModel.distance integerValue]/1000))];
        self.contentLabel.text = [[[volumStr stringByAppendingString:zongfenStr] stringByAppendingString:distanceStr] stringByAppendingString:[NSString stringWithFormat:@"%ld km",(([commodityDetailShopModel.distance integerValue]%1000))]];
    }else if(commodityDetailShopModel.distance.length <= 3){
        self.contentLabel.text = [[[NSString stringWithFormat:@" 成交%@笔 | ",commodityDetailShopModel.volume] stringByAppendingString:[NSString stringWithFormat:@" 好评%@ | ",commodityDetailShopModel.volume]] stringByAppendingString:[NSString stringWithFormat:@"%@m",commodityDetailShopModel.distance]];
    }else{
        self.contentLabel.text = [[[NSString stringWithFormat:@" 成交%@笔 | ",commodityDetailShopModel.volume] stringByAppendingString:[NSString stringWithFormat:@" 好评%@ | ",commodityDetailShopModel.volume]] stringByAppendingString:[NSString stringWithFormat:@" %ldkm",([commodityDetailShopModel.distance integerValue]/1000)]];
    }
    self.placeLabel.text = commodityDetailShopModel.address;
}

- (void)setViewUIWithHeight:(CGFloat)height
{
    self.leftImageV = [[UIImageView alloc] init];
    self.leftImageV.image = [UIImage imageNamed:@"商品背景图"];
    self.leftImageV.contentMode = UIViewContentModeScaleToFill;
    [self addSubview:self.leftImageV];
    [self.leftImageV mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.mas_left).offset(13);
        make.top.equalTo(self.mas_top).offset(15);
        make.width.equalTo(@90);
        make.height.equalTo(@60);
    }];
    
    self.titleLabel = [[UILabel alloc] init];
//    [self.titleLabel setText: @"匠心设计"];
    self.titleLabel.textColor = FONTCOLOR_BLACK;
    self.titleLabel.font = Kfont(14);
    self.titleLabel.textAlignment = NSTextAlignmentLeft;
    [self addSubview:self.titleLabel];
    [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.leftImageV.mas_right).offset(7);
        make.top.equalTo(self.mas_top).offset(15);
        make.width.equalTo(@(SCREEN_WIDTH - 130));
        make.height.equalTo(@18);
    }];
    
    self.contentLabel = [[UILabel alloc] init];
//    [self.contentLabel setText: @"成交2243笔 | 好评90% | 15km"];
    self.contentLabel.textColor = RGB_COLOR(153,153,153);
    self.contentLabel.font = Kfont(12);
    self.contentLabel.textAlignment = NSTextAlignmentLeft;
    [self addSubview:self.contentLabel];
    [self.contentLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.leftImageV.mas_right).offset(7);
        make.top.equalTo(self.titleLabel.mas_bottom);
        make.right.equalTo(self.mas_right).offset(-20);
        make.height.equalTo(@18);
    }];
    
    UIImageView * placeImageV = [[UIImageView alloc] init];
    placeImageV.image = [UIImage imageNamed:@"地址"];
    placeImageV.contentMode = UIViewContentModeScaleToFill;
    [self addSubview:placeImageV];
    [placeImageV mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.leftImageV.mas_right).offset(7);
        make.top.equalTo(self.contentLabel.mas_bottom).offset(8);
        make.width.equalTo(@16);
        make.height.equalTo(@16);
    }];
    
    self.placeLabel = [[UILabel alloc] init];
    [self.placeLabel setText: @"浙江省台州市xx区"];
    self.placeLabel.textColor = RGB_COLOR(153,153,153);
    self.placeLabel.font = Kfont(12);
    self.placeLabel.textAlignment = NSTextAlignmentLeft;
    [self addSubview:self.placeLabel];
    [self.placeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(placeImageV.mas_right).offset(10);
        make.top.equalTo(self.contentLabel.mas_bottom).offset(12);
        make.right.equalTo(self.mas_right).offset(-20);
        make.height.equalTo(@15);
    }];
    
    UILabel *lineLabel1 = [[UILabel alloc] init];
    lineLabel1.backgroundColor = RGB_COLOR(220,220,220);
    [self addSubview:lineLabel1];
    [lineLabel1 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.mas_left);
        make.top.equalTo(self.mas_bottom);
        make.right.equalTo(self.mas_right);
        make.height.equalTo(@1);
    }];
    
    
}

@end


@interface DesignThirdSectionHeaderView()

@property (nonatomic, strong) YZTagList *tagList;


@end


@implementation DesignThirdSectionHeaderView

+ (DesignThirdSectionHeaderView *)sectionHeaderViewWithHeight:(CGFloat)height
{
    DesignThirdSectionHeaderView * sectionView = [[DesignThirdSectionHeaderView alloc] initWithHeight:height];
    
    return sectionView;
}

- (instancetype)initWithHeight:(CGFloat)height
{
    self = [super init];
    if (self) {
        [self setViewUIWithHeight:height];
    }
    return self;
}

- (void)setViewUIWithHeight:(CGFloat)height
{
    UIImageView * leftImageV = [[UIImageView alloc] init];
    leftImageV.image = [UIImage imageNamed:@"红色矩形"];
    leftImageV.contentMode = UIViewContentModeScaleToFill;
    [self addSubview:leftImageV];
    [leftImageV mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.mas_left);
        make.top.equalTo(self.mas_top).offset(15);
        make.width.equalTo(@(3));
        make.height.equalTo(@23);
    }];
    
    UILabel *titleLabel = [[UILabel alloc] init];
    [titleLabel setText: @"客户评价"];
    titleLabel.textColor = FONTCOLOR_BLACK;
    titleLabel.font = Kfont(18);
    titleLabel.textAlignment = NSTextAlignmentLeft;
    [self addSubview:titleLabel];
    [titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.mas_left).offset(13);
        make.top.equalTo(self.mas_top).offset(12);
        make.width.equalTo(@(SCREEN_WIDTH - 26));
        make.height.equalTo(@30);
    }];
    
    UILabel *lineLabel2 = [[UILabel alloc] init];
    lineLabel2.backgroundColor = RGB_COLOR(220,220,220);
    [self addSubview:lineLabel2];
    [lineLabel2 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.mas_left);
        make.top.equalTo(leftImageV.mas_bottom).offset(10);
        make.right.equalTo(self.mas_right);
        make.height.equalTo(@1);
    }];
//    
//    UIView *view = [[UIView alloc] init];
//    [self addSubview:view];
//    [view mas_makeConstraints:^(MASConstraintMaker *make) {
//        make.left.equalTo(self.mas_left);
//        make.top.equalTo(lineLabel2.mas_bottom);
//        make.right.equalTo(self.mas_right);
//        make.height.equalTo(@71);
//    }];
//    
//    self.tagList = [[YZTagList alloc] init];
//    [view addSubview:self.tagList];
////    NSArray *nameArr = @[@"好评",@"严谨认真",@"不错",@"提供优质方案",@"好评",@"不错",@"严谨认真",@"提供优质方案",@"严谨认真",@"提供优质方案"];
//    
//    [self.tagList mas_makeConstraints:^(MASConstraintMaker *make) {
//        make.left.equalTo(view.mas_left);
//        make.top.equalTo(view.mas_top);
//        make.width.equalTo(view.mas_width);
//        make.height.equalTo(view.mas_height);
//    }];
//    // 点击标签，就会调用,点击标签，删除标签
//     self.tagList.clickTagBlock = ^(NSString *tag){
//        
//    };
//    // 设置标签背景色
//     self.tagList.tagBackgroundColor = [UIColor whiteColor];
//    //设置标签颜色
//     self.tagList.tagColor = RGB_COLOR(237,34,59);
//     self.tagList.tagMargin = 8;
//     self.tagList.tagFont = Kfont(10);
//     self.tagList.borderWidth = 0.5;
//     self.tagList.borderColor = RGB_COLOR(237,34,59);
//     self.tagList.tagCornerRadius = 11;
//     self.tagList.tagListH = 15;
//     self.tagList.tagListCols = 2;
    
//    [self.tagList addTags:nameArr];
}

- (void)titlesName:(NSArray *)titles
{
    [self.tagList addTags:titles];
}


@end

@implementation DesignFourSectionHeaderView

+ (DesignFourSectionHeaderView *)sectionHeaderViewWithHeight:(CGFloat)height
{
    DesignFourSectionHeaderView * sectionView = [[DesignFourSectionHeaderView alloc] initWithHeight:height];
    
    return sectionView;
}

- (instancetype)initWithHeight:(CGFloat)height
{
    self = [super init];
    if (self) {
        [self setViewUIWithHeight:height];
    }
    return self;
}

- (void)setViewUIWithHeight:(CGFloat)height
{
    UIImageView * leftImageV = [[UIImageView alloc] init];
    leftImageV.image = [UIImage imageNamed:@"红色矩形"];
    leftImageV.contentMode = UIViewContentModeScaleToFill;
    [self addSubview:leftImageV];
    [leftImageV mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.mas_left);
        make.top.equalTo(self.mas_top).offset(15);
        make.width.equalTo(@(3));
        make.height.equalTo(@23);
    }];
    
    UILabel *titleLabel = [[UILabel alloc] init];
    [titleLabel setText: @"详情"];
    titleLabel.textColor = FONTCOLOR_BLACK;
    titleLabel.font = Kfont(18);
    titleLabel.textAlignment = NSTextAlignmentLeft;
    [self addSubview:titleLabel];
    [titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.mas_left).offset(13);
        make.top.equalTo(self.mas_top).offset(12);
        make.width.equalTo(@(SCREEN_WIDTH - 26));
        make.height.equalTo(@30);
    }];
}


@end

@interface DesignFifthSectionHeaderView()<SDCycleScrollViewDelegate>

@property (nonatomic,strong)  NSArray * packagPicsArray;
@property (nonatomic,strong)  NSArray * picsArray;
@property (nonatomic,assign)  BuyType   buyType;
@property (nonatomic,strong)  UILabel * titlelabel;
@property (nonatomic,strong)  SDCycleScrollView *scrollView;

@end

@implementation DesignFifthSectionHeaderView

+(DesignFifthSectionHeaderView *)sectionHeaderViewWithHeight:(CGFloat)height{
    DesignFifthSectionHeaderView *sectionView = [[DesignFifthSectionHeaderView alloc] initWithHeight:height];
    
    return sectionView;
}

- (instancetype)initWithHeight:(CGFloat)height
{
    self = [super init];
    if (self) {
        [self setViewUIWithHeight:height];
    }
    return self;
}

-(void)setPackagingExcipientModel:(PackagingExcipientModel *)packagingExcipientModel
{
    _packagingExcipientModel = packagingExcipientModel;
    
    _packagPicsArray = self.packagingExcipientModel.pics;
}

- (void)setViewUIWithHeight:(CGFloat)height
{
    UIView *view = [[UIView alloc] init];
    [self addSubview:view];
    [view mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.mas_left);
        make.right.equalTo(self.mas_right);
        make.width.equalTo(self.mas_width);
        make.height.equalTo(self.mas_height);
    }];
    
    _scrollView = [[SDCycleScrollView alloc] init];
    _scrollView.backgroundColor = UIColorFromRGB(@"E6E6E6", 1);
    _scrollView.currentPageDotColor = RGB_COLOR(237,34,59);
    _scrollView.pageDotColor = RGB_COLOR(238,238,238);
    //    [scrollView setCurrentPageDotImage:[UIImage imageNamed:@"轮播圈红色"]];
    _scrollView.showPageControl = YES;
    _scrollView.autoScrollTimeInterval = 4.0;
    //    NSMutableArray *photoArray = [NSMutableArray array];
    //    scrollView.imageURLStringsGroup = array;
    self.picsArray = @[[UIImage imageNamed:@"商品背景图"],[UIImage imageNamed:@"商品背景图"],[UIImage imageNamed:@"商品背景图"],[UIImage imageNamed:@"商品背景图"]];
    if (self.buyType == BuyType_PackageBuy) {
        _scrollView.localizationImageNamesGroup = self.packagPicsArray;
    }
    _scrollView.localizationImageNamesGroup = self.picsArray;
    _scrollView.scrollDirection = UICollectionViewScrollDirectionHorizontal;
    _scrollView.pageControlAliment = SDCycleScrollViewPageContolAlimentCenter;
    _scrollView.delegate = self;
    [view addSubview:_scrollView];
    [_scrollView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.mas_left);
        make.top.equalTo(self.mas_top);
        make.width.equalTo(self.mas_width);
        make.height.equalTo(@(ScreenX375(190)));
    }];
    
    UIImageView * leftImageV = [[UIImageView alloc] init];
    leftImageV.image = [UIImage imageNamed:@"红色矩形"];
    leftImageV.contentMode = UIViewContentModeScaleToFill;
    [view addSubview:leftImageV];
    [leftImageV mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.mas_left);
        make.top.equalTo(self.scrollView.mas_bottom).offset(20);
        make.width.equalTo(@(3));
        make.height.equalTo(@23);
    }];
    
    _titlelabel = [[UILabel alloc] init];
    [_titlelabel setText: @"潜水泵常用纸箱"];
    _titlelabel.numberOfLines = 0;
    _titlelabel.textColor = FONTCOLOR_BLACK;
    _titlelabel.font = Kfont(18);
    _titlelabel.textAlignment = NSTextAlignmentLeft;
    [view addSubview:_titlelabel];
    [_titlelabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(view.mas_left).offset(13);
        make.top.equalTo(self.scrollView.mas_bottom).offset(22);
        make.width.equalTo(@(SCREEN_WIDTH - 60));
        make.height.equalTo(@18);
    }];
    
    UILabel *lineLabel = [[UILabel alloc] init];
    lineLabel.backgroundColor = RGB_COLOR(220,220,220);
    [view addSubview:lineLabel];
    [lineLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.mas_left);
        make.top.equalTo(self.mas_bottom);
        make.right.equalTo(self.mas_right);
        make.height.equalTo(@1);
    }];
    
}

-(void)initWithModel:(PaperBoxDetialModel *)model{
    _titlelabel.text = model.goods_name;
}

-(void)initWithModel2:(PackagingExcipientModel *)model {
    _titlelabel.text = model.goods_name;
}

-(void)initWithArray:(NSMutableArray *)array{
    self.scrollView.localizationImageNamesGroup = array;
}

@end

@implementation DesignSixthSectionHeaderView

+ (DesignSixthSectionHeaderView *)sectionHeaderViewWithHeight:(CGFloat)height
{
    DesignSixthSectionHeaderView * sectionView = [[DesignSixthSectionHeaderView alloc] initWithHeight:height];
    
    return sectionView;
}

- (instancetype)initWithHeight:(CGFloat)height
{
    self = [super init];
    if (self) {
        [self setViewUIWithHeight:height];
    }
    return self;
}

- (void)setViewUIWithHeight:(CGFloat)height
{
    UIImageView * leftImageV = [[UIImageView alloc] init];
    leftImageV.image = [UIImage imageNamed:@"红色矩形"];
    leftImageV.contentMode = UIViewContentModeScaleToFill;
    [self addSubview:leftImageV];
    [leftImageV mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.mas_left);
        make.top.equalTo(self.mas_top).offset(15);
        make.width.equalTo(@(3));
        make.height.equalTo(@23);
    }];
    
    UILabel *titleLabel = [[UILabel alloc] init];
    [titleLabel setText: @"相关商品"];
    titleLabel.textColor = FONTCOLOR_BLACK;
    titleLabel.font = Kfont(18);
    titleLabel.textAlignment = NSTextAlignmentLeft;
    [self addSubview:titleLabel];
    [titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.mas_left).offset(13);
        make.top.equalTo(self.mas_top).offset(18);
        make.width.equalTo(@(SCREEN_WIDTH - 26));
        make.height.equalTo(@18);
    }];
    
    UILabel *lineLabel2 = [[UILabel alloc] init];
    lineLabel2.backgroundColor = RGB_COLOR(220,220,220);
    [self addSubview:lineLabel2];
    [lineLabel2 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.mas_left);
        make.top.equalTo(leftImageV.mas_bottom).offset(10);
        make.right.equalTo(self.mas_right);
        make.height.equalTo(@1);
    }];
    
    UIButton *more =[[UIButton alloc] initWithFrame:CGRectMake(ScreenX375(310), ScreenX375(20.5), ScreenX375(50), ScreenX375(12))];
    [more setImage:[UIImage imageNamed:@"更多"] forState:UIControlStateNormal];
    [more setTitleColor:REXADECIMALCOLOR(@"#999999") forState:UIControlStateNormal];
    [more setTitle:@"更多" forState:UIControlStateNormal];
    [more setTitleEdgeInsets:UIEdgeInsetsMake(0, - more.imageView.image.size.width, 0, more.imageView.image.size.width)];
    [more setImageEdgeInsets:UIEdgeInsetsMake(0, more.titleLabel.bounds.size.width, 0, -more.titleLabel.bounds.size.width)];
    more.titleLabel.font = Kfont(12);
    [self addSubview:more];
}

@end

@implementation OrderFirstSectionHeaderView

+ (OrderFirstSectionHeaderView *)sectionHeaderViewWithHeight:(CGFloat)height
{
    OrderFirstSectionHeaderView * sectionView = [[OrderFirstSectionHeaderView alloc] initWithHeight:height];
    
    return sectionView;
}

- (instancetype)initWithHeight:(CGFloat)height
{
    self = [super init];
    if (self) {
        [self setViewUIWithHeight:height];
    }
    return self;
}

- (void)setViewUIWithHeight:(CGFloat)height
{
    UIImageView * leftImageV = [[UIImageView alloc] init];
    leftImageV.image = [UIImage imageNamed:@"红色矩形"];
    leftImageV.contentMode = UIViewContentModeScaleToFill;
    [self addSubview:leftImageV];
    [leftImageV mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.mas_left);
        make.top.equalTo(self.mas_top).offset(15);
        make.width.equalTo(@(3));
        make.height.equalTo(@23);
    }];
    
    UILabel *titleLabel = [[UILabel alloc] init];
    [titleLabel setText: @"收货地址"];
    titleLabel.textColor = FONTCOLOR_BLACK;
    titleLabel.font = Kfont(18);
    titleLabel.textAlignment = NSTextAlignmentLeft;
    [self addSubview:titleLabel];
    [titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.mas_left).offset(13);
        make.top.equalTo(self.mas_top).offset(15);
        make.width.equalTo(@(SCREEN_WIDTH - 26));
        make.height.equalTo(@18);
    }];
    
    UILabel *lineLabel2 = [[UILabel alloc] init];
    lineLabel2.backgroundColor = RGB_COLOR(220,220,220);
    [self addSubview:lineLabel2];
    [lineLabel2 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.mas_left);
        make.top.equalTo(leftImageV.mas_bottom).offset(10);
        make.right.equalTo(self.mas_right);
        make.height.equalTo(@1);
    }];
}

@end

@implementation OrderSecondSectionHeaderView

+ (OrderSecondSectionHeaderView *)sectionHeaderViewWithHeight:(CGFloat)height
{
    OrderSecondSectionHeaderView * sectionView = [[OrderSecondSectionHeaderView alloc] initWithHeight:height];
    
    return sectionView;
}

- (instancetype)initWithHeight:(CGFloat)height
{
    self = [super init];
    if (self) {
        [self setViewUIWithHeight:height];
    }
    return self;
}

- (void)setViewUIWithHeight:(CGFloat)height
{
    UIImageView * leftImageV = [[UIImageView alloc] init];
    leftImageV.image = [UIImage imageNamed:@"红色矩形"];
    leftImageV.contentMode = UIViewContentModeScaleToFill;
    [self addSubview:leftImageV];
    [leftImageV mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.mas_left);
        make.top.equalTo(self.mas_top).offset(15);
        make.width.equalTo(@(3));
        make.height.equalTo(@23);
    }];
    
    UILabel *titleLabel = [[UILabel alloc] init];
    [titleLabel setText: @"快递方式"];
    titleLabel.textColor = FONTCOLOR_BLACK;
    titleLabel.font = Kfont(18);
    titleLabel.textAlignment = NSTextAlignmentLeft;
    [self addSubview:titleLabel];
    [titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.mas_left).offset(13);
        make.top.equalTo(self.mas_top).offset(15);
        make.width.equalTo(@(SCREEN_WIDTH - 26));
        make.height.equalTo(@18);
    }];
    
    UILabel *lineLabel2 = [[UILabel alloc] init];
    lineLabel2.backgroundColor = RGB_COLOR(220,220,220);
    [self addSubview:lineLabel2];
    [lineLabel2 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.mas_left);
        make.top.equalTo(leftImageV.mas_bottom).offset(10);
        make.right.equalTo(self.mas_right);
        make.height.equalTo(@1);
    }];
}

@end

@implementation OrderThirdSectionHeaderView

+ (OrderThirdSectionHeaderView *)sectionHeaderViewWithHeight:(CGFloat)height
{
    OrderThirdSectionHeaderView * sectionView = [[OrderThirdSectionHeaderView alloc] initWithHeight:height];
    
    return sectionView;
}

- (instancetype)initWithHeight:(CGFloat)height
{
    self = [super init];
    if (self) {
        [self setViewUIWithHeight:height];
    }
    return self;
}

- (void)setViewUIWithHeight:(CGFloat)height
{
    UIImageView * leftImageV = [[UIImageView alloc] init];
    leftImageV.image = [UIImage imageNamed:@"红色矩形"];
    leftImageV.contentMode = UIViewContentModeScaleToFill;
    [self addSubview:leftImageV];
    [leftImageV mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.mas_left);
        make.top.equalTo(self.mas_top).offset(15);
        make.width.equalTo(@(3));
        make.height.equalTo(@23);
    }];
    
    UILabel *titleLabel = [[UILabel alloc] init];
    [titleLabel setText: @"发票"];
    titleLabel.textColor = FONTCOLOR_BLACK;
    titleLabel.font = Kfont(18);
    titleLabel.textAlignment = NSTextAlignmentLeft;
    [self addSubview:titleLabel];
    [titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.mas_left).offset(13);
        make.top.equalTo(self.mas_top).offset(15);
        make.width.equalTo(@(SCREEN_WIDTH - 26));
        make.height.equalTo(@18);
    }];
    
    UILabel *lineLabel2 = [[UILabel alloc] init];
    lineLabel2.backgroundColor = RGB_COLOR(220,220,220);
    [self addSubview:lineLabel2];
    [lineLabel2 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.mas_left);
        make.top.equalTo(leftImageV.mas_bottom).offset(10);
        make.right.equalTo(self.mas_right);
        make.height.equalTo(@1);
    }];
}
@end

@implementation OrderFourthSectionHeaderView

+ (OrderFourthSectionHeaderView *)sectionHeaderViewWithHeight:(CGFloat)height
{
    OrderFourthSectionHeaderView * sectionView = [[OrderFourthSectionHeaderView alloc] initWithHeight:height];
    
    return sectionView;
}

- (instancetype)initWithHeight:(CGFloat)height
{
    self = [super init];
    if (self) {
        [self setViewUIWithHeight:height];
    }
    return self;
}

- (void)setViewUIWithHeight:(CGFloat)height
{
    UIImageView * leftImageV = [[UIImageView alloc] init];
    leftImageV.image = [UIImage imageNamed:@"红色矩形"];
    leftImageV.contentMode = UIViewContentModeScaleToFill;
    [self addSubview:leftImageV];
    [leftImageV mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.mas_left);
        make.top.equalTo(self.mas_top).offset(15);
        make.width.equalTo(@(3));
        make.height.equalTo(@23);
    }];
    
    UILabel *titleLabel = [[UILabel alloc] init];
    [titleLabel setText: @"其他"];
    titleLabel.textColor = FONTCOLOR_BLACK;
    titleLabel.font = Kfont(18);
    titleLabel.textAlignment = NSTextAlignmentLeft;
    [self addSubview:titleLabel];
    [titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.mas_left).offset(13);
        make.top.equalTo(self.mas_top).offset(15);
        make.width.equalTo(@(SCREEN_WIDTH - 26));
        make.height.equalTo(@18);
    }];
    
    UILabel *lineLabel2 = [[UILabel alloc] init];
    lineLabel2.backgroundColor = RGB_COLOR(220,220,220);
    [self addSubview:lineLabel2];
    [lineLabel2 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.mas_left);
        make.top.equalTo(leftImageV.mas_bottom).offset(10);
        make.right.equalTo(self.mas_right);
        make.height.equalTo(@1);
    }];
}
@end

@implementation OrderFifthSectionHeaderView

+ (OrderFifthSectionHeaderView *)sectionHeaderViewWithHeight:(CGFloat)height
{
    OrderFifthSectionHeaderView * sectionView = [[OrderFifthSectionHeaderView alloc] initWithHeight:height];
    
    return sectionView;
}

- (instancetype)initWithHeight:(CGFloat)height
{
    self = [super init];
    if (self) {
        [self setViewUIWithHeight:height];
    }
    return self;
}

- (void)setViewUIWithHeight:(CGFloat)height
{
    UIImageView * leftImageV = [[UIImageView alloc] init];
    leftImageV.image = [UIImage imageNamed:@"红色矩形"];
    leftImageV.contentMode = UIViewContentModeScaleToFill;
    [self addSubview:leftImageV];
    [leftImageV mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.mas_left);
        make.top.equalTo(self.mas_top).offset(15);
        make.width.equalTo(@(3));
        make.height.equalTo(@23);
    }];
    
    UILabel *titleLabel = [[UILabel alloc] init];
    [titleLabel setText: @"商品信息"];
    titleLabel.textColor = FONTCOLOR_BLACK;
    titleLabel.font = Kfont(18);
    titleLabel.textAlignment = NSTextAlignmentLeft;
    [self addSubview:titleLabel];
    [titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.mas_left).offset(13);
        make.top.equalTo(self.mas_top).offset(15);
        make.width.equalTo(@(SCREEN_WIDTH - 26));
        make.height.equalTo(@18);
    }];
    
    UILabel *lineLabel2 = [[UILabel alloc] init];
    lineLabel2.backgroundColor = RGB_COLOR(220,220,220);
    [self addSubview:lineLabel2];
    [lineLabel2 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.mas_left);
        make.top.equalTo(leftImageV.mas_bottom).offset(10);
        make.right.equalTo(self.mas_right);
        make.height.equalTo(@1);
    }];
}
@end

